import request from '@/utils/request'

// 查询订单站内信列表
export function listOrderLetter(query) {
  return request({
    url: '/hmk/orderLetter/list',
    method: 'get',
    params: query
  })
}

// 查询订单站内信详细
export function getOrderLetter(id) {
  return request({
    url: '/hmk/orderLetter/' + id,
    method: 'get'
  })
}

// 新增订单站内信
export function addOrderLetter(data) {
  return request({
    url: '/hmk/orderLetter',
    method: 'post',
    data: data
  })
}

export function updateOrderLetterReplyStatus(data) {
  return request({
    url: '/hmk/orderLetter/updateOrderLetterReplyStatus',
    method: 'post',
    data: data
  })
}

export function getOrderMessageNumber(data) {
  return request({
    url: '/hmk/orderLetter/getOrderMessageNumber',
    method: 'post',
    headers: {
      repeatSubmit: false
    },
    data: data
  })
}

// 修改订单站内信
export function updateOrderLetter(data) {
  return request({
    url: '/hmk/orderLetter',
    method: 'put',
    data: data
  })
}

// 删除订单站内信
export function delOrderLetter(id) {
  return request({
    url: '/hmk/orderLetter/' + id,
    method: 'delete'
  })
}
